package cn.com.resoft.integrate.sync;

import cn.com.infostrategy.ui.mdata.BillListPanel;
import cn.com.infostrategy.ui.mdata.BillTreePanel;
import cn.com.infostrategy.ui.mdata.BillTreeSelectListener;
import cn.com.infostrategy.ui.mdata.BillTreeSelectionEvent;
import cn.com.infostrategy.ui.mdata.styletemplet.t0A.AbstractStyleWorkPanel_0A;
import cn.com.infostrategy.ui.mdata.styletemplet.t0A.IUIIntercept_0A;

public class SyncHRCorpUserIntegrate  implements IUIIntercept_0A, BillTreeSelectListener {

	private BillTreePanel hrTreePanel;
	private BillListPanel hrListPanel;
	private BillListPanel hruserPanel;

	public void afterSysInitialize(AbstractStyleWorkPanel_0A _panel) throws Exception {
		// TODO Auto-generated method stub

		hrTreePanel = _panel.getBillTreePanelByTempletCode("hr_view_org_CODE1");
		hrTreePanel.addBillTreeSelectListener(this);
		//hrTreePanel.queryDataByCondition(" 1=1 ");
		hrTreePanel.queryDataByDS("szrcb_hr", " select * from hr_view_org ");
		hrListPanel = _panel.getBillListPanelByTempletCode("hr_view_org_CODE1");
		hruserPanel = _panel.getBillListPanelByTempletCode("hr_view_person_CODE1");

	}

	public void onBillTreeSelectChanged(BillTreeSelectionEvent _event) {

		String id = hrTreePanel.getSelectedVO().getStringValue("id","-1");
		hrListPanel.queryDataByDS("szrcb_hr", " select * from hr_view_org    where id = '"+id+"'");
		hruserPanel.queryDataByDS("szrcb_hr", " select * from hr_view_person where SECONDDEPTID = '"+id+"'");
	}


}
